from urllib import request

from django.template.library import Library
from main.models import Categorize

register = Library()

@register.simple_tag
def get_categorizes():
    return Categorize.objects.filter(parent__isnull=True)


@register.filter
def user_artile(value):
    return value.filter(value.author==request.username)
